import logging

import pytest

from resource.pom.mms import MMS


class Test:
    app = MMS

    @pytest.mark.parametrize('setup_teardown', [app.bundle_name], indirect=True)
    def test(self, setup_teardown, device):
        for i in range(5):
            logging.info('步骤1.{}：进入信息应用'.format(i))
            device.start_ability(self.app.bundle_name, self.app.ability_name)
            logging.info('预期结果1.{}：信息应用打开无卡死、黑屏、白屏等现象'.format(i))
            device.assert_current_window(self.app.window_name)
            device.refresh_layout()
            device.assert_text_exist('信息')
            device.go_home()
            device.wait(1)
